<%@ tag language="java" pageEncoding="UTF-8" body-content="empty" trimDirectiveWhitespaces="true"%>
<%@ attribute name="id" type="java.lang.String" required="true" description="id" %>
<%@ attribute name="codeType" type="java.lang.String" required="true" description="依据codeType查询码表"%>
<%@ attribute name="name" type="java.lang.String" required="false" description="定义select的name属性"%>
<%@ attribute name="className" type="java.lang.String" required="false" description="定义select的class属性"%>
<%@ attribute name="async" type="java.lang.Boolean" required="false" description="异步：true（默认），同步：false"%>
<%@ attribute name="showSelectAll" type="java.lang.Boolean" required="false" description="是否显示选择所有选项，默认false"%>
<%@ attribute name="showSelectName" type="java.lang.String" required="false" description="选择所有选项的名称，默认为'全部'，设置此选项需先设置showSelectAll为'true'"%>
<%@ attribute name="showSelectValue" type="java.lang.String" required="false" description="选择所有选项的值，默认为空，设置此选项需先设置showSelectAll为'true'"%>
<%@ attribute name="onSuccess" type="java.lang.String" required="false" description="下拉标签初始化完成后绑定事件"%>
<%@ attribute name="readonly" type="java.lang.Boolean" required="false" description="是否禁用输入"%>
<%@ attribute name="onChange" type="java.lang.String" required="false" description="选择下拉框触发的事件"%>	
<%@ attribute name="onBlur" type="java.lang.String" required="false" description="失去焦点触发的事件"%>
<%@ attribute name="defaultValue" type="java.lang.String" required="false" description="设置默认值"%>
<div id='${id}'></div>
<script type="text/javascript">
(function(){
	var showSelectAll = '${showSelectAll}'==""?false:"${showSelectAll}"=="true";
	var showSelectName = '${showSelectName}'==""?"全部":"${showSelectName}";
	var showSelectValue = '${showSelectValue}'==""?"":"${showSelectValue}";
	var event = '${onSuccess}' == ""?undefined : eval("${onSuccess}");
	var onChangeFunc = '${onChange}' == ""?undefined : eval("${onChange}");
	var onBlurFunc = '${onBlur}' == ""?undefined : eval("${onBlur}");
	var async = '${async}'=='false'?false:true;
	Logger.warn("droptag = ${readonly}");
	new ComplexSelect('${id}','code',{
		'codeType':'${codeType}',
		'name':'${name}',
		'className':'${className}',
		'showSelectAll':showSelectAll,
		'showSelectName':showSelectName,
		'showSelectValue':showSelectValue,
		'async':async,
		'event':event,
		'onChange':onChangeFunc, 
		'onBlur':onBlurFunc,
		'readonly':'${readonly}',
		'onChangeEvent':"${onChange}",
		'defaultValue':'${defaultValue}',
	});
})();
</script>





